﻿@using Volo.Abp.AspNetCore.Mvc.AntiForgery
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Bundling
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Themes.SB.Components.MainNavbar
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Themes.SB.Components.PageAlerts
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Themes.SB.Components.Toolbar
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Themes.SB.Components.LogoutModal
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.SB.Localization.SBTheme;
@using Microsoft.AspNetCore.Mvc.Localization;
@using Volo.Abp.AspNetCore.Mvc.UI.Layout;

@inject IHtmlLocalizer<SBThemeResource> L
@inject IBrandingProvider BrandingProvider
@inject IAbpAntiForgeryManager AbpAntiForgeryManager

@inject IPageLayout PageLayout

@{
    Layout = null;
    //主要是为了配合客户端abp的js脚本使用同一个XSRF-TOKEN
    //第一次会生成两个cookie(.AspNetCore.Antiforgery.xxx|XSRF-TOKEN)两个值不同
    //如果客户端有了.AspNetCore.Antiforgery.xxx就不会再次传给客户端
    AbpAntiForgeryManager.SetCookie();
}

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>@(ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title)</title>

    <abp-style-bundle name="@SBThemeBundles.Styles.Global" />

    @await RenderSectionAsync("styles", false)
</head>


<body class="abp-application-layout" id="page-top">
    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        @(await Component.InvokeAsync<MainNavbarViewComponent>
            ())
        <!-- End of Sidebar -->
        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                @(await Component.InvokeAsync<ToolbarViewComponent>
                    ())
                <!-- End of Topbar -->
                <!-- Begin Page Content -->
                <div class="container-fluid">

                    @if (PageLayout.Content.ShouldShowBreadCrumb())
                    {
                        <abp-breadcrumb>
                            @if (PageLayout.Content.BreadCrumb.ShowHome)
                            {
                                <abp-breadcrumb-item href="/" title="@L["BreadCrumb:Home"].Value" />
                            }

                            @foreach (var item in PageLayout.Content.BreadCrumb.Items)
                            {
                                <abp-breadcrumb-item href="@item.Url" title="@item.Text" />
                            }

                            @if (PageLayout.Content.BreadCrumb.ShowCurrent)
                            {
                                <abp-breadcrumb-item href="" title="@PageLayout.Content.Title" />
                            }

                        </abp-breadcrumb>
                    }

                    @(await Component.InvokeAsync<PageAlertsViewComponent>
                        ())

                    @RenderBody()

                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->
            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; 2019</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->
    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    @(await Component.InvokeAsync<LogoutModalViewComponent>
        ())

    <abp-script-bundle name="@SBThemeBundles.Scripts.Global" />
    <script type="text/javascript" src="~/Abp/ApplicationConfigurationScript"></script>
    <script type="text/javascript" src="~/Abp/ServiceProxyScript"></script>
    @await RenderSectionAsync("scripts", false)

</body>
</html>